<html>
  <head>
    <meta name="GENERATOR" content="BLOCKNOTE.NET"/>
    <meta name="source"/>
    <basefont face="Verdana" size="2"/>
    <meta name="generator" content="h-smile:richtext"/>
  </head>
<body>
  <h1>Index object</h1>
  <p>Index object in persistent storage.</p>
  <div align="left">
    <table border="0" cellpadding="4" cellspacing="4" width="100%">
      <tr>
        <td colspan="2">
          <h2>Properties</h2></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>length</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">- <em>integer</em>, length of an index, number of objects associated represented by the index. Read-only property.</td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>asc</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">- <em>boolean</em>, direction of access of objects from the index. Write-only property.</td></tr>
      <tr>
        <td width="117" bgcolor="#ffffff" valign="top" align="right"><strong><em>[key]</em></strong></td>
        <td bgcolor="#fffff0" valign="middle"><strong>- </strong><em>value</em>, element of the DbIndex at the <em>key</em> position. Read/Write accessor by <em>key</em>. <em>key</em> has to be of the same type as the type of <em>DbIndex</em> object</td></tr>
      <tr>
        <td width="117" bgcolor="#ffffff" valign="top" align="right"><strong><em>[begin..end]</em></strong></td>
        <td bgcolor="#fffff0" valign="middle"><strong>- </strong><em>keys</em>, keys of first and last element of the range. Returns slice of DbIndex which contains elements from <em>start</em> key and up to <em>end</em> key. <br/><em>begin is a </em>low<em> boundary of key value (if null then there is no low boundary)</em>.<br/><em>end</em> is a high boundary of key value (if <em>null</em> then there is no high boundary).</td></tr>
      <tr>
        <td colspan="2" valign="top">
          <h2>Methods</h2></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>add</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( key, val [, replace: true|false ] ) : true|false</p>
          <p>Inserts <em>val</em> object into <em>Index</em> and associates it with <em>key</em> value. Optionally replaces it with existing object if it exists.</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>remove</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <div>( key [,obj] ) returns: true | false</div>
          <p>Method removes object <em>obj</em> by <em>key</em> from the index. Method returns <em>true</em> on success, otherwise <em>false</em>.<br/>If <em>Index</em> is unique, <em>obj</em> is optional.</p></td></tr>
      <tr>
        <td bgcolor="#ffffff" valign="top" align="right"><strong><em>select</em></strong></td>
        <td bgcolor="#fffff0" valign="middle">
          <p>( min-key, max-key [, ascent [, start-inclusive [, end-inclusive]]] ) returns: selection object.</p>
          <p>Returns selection in the <em>Index</em> based on criteria <em>min-key, max-key, ascent </em>or<em> descent </em>order<em>, start-inclusive, end-inclusive</em>. Default values:</p>
          <ul>
            <li><em>ascent = true</em></li>
            <li><em>start-inclusive = true</em></li>
            <li><em>end-inclusive = true</em></li></ul>
          <p>Example:<br/>var sel = index.select(minVal, maxVal, true);<br/>for( var obj in sel ) { ... }</p></td></tr></table></div>
</body>
</html>